package com.company.cloud.coupon.modules.api.service;

import com.company.cloud.common.bean.BaseClientResult;
import com.company.common.server.constant.ServiceNameConstant;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

import com.company.cloud.coupon.modules.api.fallback.CouponRemoteServiceFallbackFactory;
import com.company.cloud.coupon.modules.api.request.Lock2UseCouponRequest;
import com.company.cloud.coupon.modules.api.request.LockCouponRequest;
import com.company.cloud.coupon.modules.api.request.UnLockCouponRequest;
import com.company.cloud.coupon.modules.api.request.Use2notCouponRequest;
import com.company.cloud.coupon.modules.api.request.UseCouponRequest;
import com.company.cloud.coupon.modules.api.response.LockCouponResponse;
import com.company.cloud.coupon.modules.api.response.UseCouponResponse;

@FeignClient(contextId = "op-coupon", name = ServiceNameConstant.coupon_center, fallbackFactory = CouponRemoteServiceFallbackFactory.class)
public interface CouponRemoteService {

	/**
	 * 锁定优惠券
	 */
	@PostMapping("/remote/coupon/lockCoupon")
	public BaseClientResult<LockCouponResponse> lockCoupon(@RequestBody LockCouponRequest param);

	/**
	 * 解除锁定优惠券
	 */
	@PostMapping("/remote/coupon/unLockCoupon")
	public BaseClientResult<String> unLockCoupon(@RequestBody UnLockCouponRequest param);

	/**
	 * 锁定优惠券转使用
	 */
	@PostMapping("/remote/coupon/lock2UseCoupon")
	public BaseClientResult<String> lock2UseCoupon(@RequestBody Lock2UseCouponRequest param);

	/**
	 * 直接使用优惠券
	 */
	@PostMapping("/remote/coupon/useCoupon")
	public BaseClientResult<UseCouponResponse> useCoupon(@RequestBody UseCouponRequest param);

	/**
	 * 使用优惠券退还
	 */
	@PostMapping("/remote/coupon/use2notCoupon")
	public BaseClientResult<String> use2notCoupon(@RequestBody Use2notCouponRequest param);

}
